<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<script>
   $(function() {
     
      $("#searchbtn").click(function() {
         var search = $("#search").val();
         $("#search").attr('value',search);
         location.href = "recruit_search.do?search=" + search;
      });
   });
</script>
<div id="content_work">
	<!-- 컨텐츠 -->
	<div class="work_contents3">
		<h1>
			<img src="images/newcomer/re_notice_title.gif" alt="채용공고">
		</h1>
    <br>
    <table width="710">
      <tr> 
        <td>
          <select name="type" id="type" id="cboRecruit" 
            style="height: 23px; border: 1px solid #320c43; z-index: 20; background-color: #FAF7FF; width: 60px;">
              <option value="title">제목</option>
          </select>
          <input type="text" id="search" name="search" 
                 style="height: 21px; border: 1px solid #320c43; z-index: 20; background-color: #FAF7FF; value="">
          <input type="button" id="searchbtn" value="검색" 
                 style="height: 23px; border: 1px solid #320c43; z-index: 20; background-color: #FAF7FF;
                 padding: 0 10px 0 8px; line-height: 23px;">
        </td>
        <td align="right">
          <a href="admin_recruit_form.do">
            <button style="height: 23px; border: 1px solid #320c43; z-index: 20; background-color: #FAF7FF;
                    padding: 0 10px 0 8px; line-height: 23px;">글쓰기</button>
          </a>
        </td>
      </tr>
    </table>   
   <table class="tbl_type ma_b25 ma_t27" border="0" cellspacing="0" cellpadding="0">
			<tbody>
				<tr>
          <th>공고번호</th>
					<th>채용부문</th>
					<th>모집대상</th>
					<th>접수기간</th>
				</tr>

				<c:forEach var="recruit_list" items="${list }">
					<tr align="left">				
            <td class="td_t_bo td_b_bo">${recruit_list.rcrt_num}</td>		    
						<c:choose>
                <c:when test="${fn:length(recruit_list.recruit_nm) > 50}">
                     <td class="td_t_bo td_b_bo al_l pd_l10" align="left">
                        <a href="admin_recruit_detail.do?rcrt_num=${recruit_list.rcrt_num }">
                          <c:out value="${fn:substring(recruit_list.recruit_nm,0,49)}" />...</a>
                      </td>
                </c:when>
                <c:otherwise>
                     <td class="td_t_bo td_b_bo al_l pd_l10" align="left">
                        <a href="admin_recruit_detail.do?rcrt_num=${recruit_list.rcrt_num }">
                            <c:out value="${recruit_list.recruit_nm}" /></a>
                     </td>
                </c:otherwise>
            </c:choose>       
            <td class="td_t_bo td_b_bo">${recruit_list.recruit_cd }</td>		
						<td class="td_l_bo td_t_bo td_b_bo al_l">${recruit_list.app_strt_dt } - ${recruit_list.app_end_dt } </td>										
					</tr>
				</c:forEach>
			</tbody>	
		</table>

    <table width="710">
      <tr>
        <td align="center">
          <!-- 처음 이전 링크 --> <c:if test="${map.pg!=1}">  
         [<a href="admin_recruit_list.do?pg=1">◀◀</a>]
         [<a href="admin_recruit_list.do?pg=${map.pg-1}">◀</a>]      
      </c:if> <!-- 블록 범위 찍기 --> <c:forEach begin="${map.fromPage}" end="${map.toPage}" var="i">
            <c:if test="${i==map.pg}"><b>[${i}]</b></c:if>
            <c:if test="${i!=map.pg}">
            [<a href="admin_recruit_list.do?pg=${i}">${i}</a>]
         </c:if>
          </c:forEach> <!-- 다음, 이후 --> <c:if test="${map.pg!=map.allPage}">  
         [<a href="admin_recruit_list.do?pg=${map.pg+1}">▶</a>]      
         [<a href="admin_recruit_list.do?pg=${map.allPage}">▶▶</a>]
      </c:if>
        </td>
      </tr>
    </table>
	</div>
	<!-- 컨텐츠 -->
</div>